package org.yy.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.yy.pojo.AuthCode;

import java.util.Date;
import java.util.List;
import java.util.Optional;

public interface AuthCodeDao extends JpaRepository<AuthCode, Long> {

//    @Query(value = "SELECT * FROM lagou_auth_code WHERE email=?1 AND code=?2 AND expiretime >= ?3")
//    List<AuthCode> findCode(String email, String code, Date expiretime);

    List<AuthCode> findByEmailAndCodeAndExpiretimeAfter(String email, String code, Date expiretime);
}
